package org.idea.spring.condition.selfconditioninject;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @Author linhao
 * @Date created in 12:02 下午 2021/5/8
 */
public class Version1Condition implements Condition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        String gitBranch = context.getEnvironment().getProperty("git.branch");
        return gitBranch.equals("1");
    }
}
